package com.ylbh.modules.goodsorder.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ylbh.common.exception.NormalException;
import com.ylbh.common.pojo.goodsorder.dto.OrderConditionDTO;
import com.ylbh.common.pojo.goodsorder.vo.*;
import com.ylbh.common.pojo.goodsorder.dto.OrderShipmentDTO;
import com.ylbh.common.utils.PageUtils;
import com.ylbh.modules.goodsorder.entity.ShoppingOrderForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 *
 * 商品订单
 * @author czx
 * @date 2019-04-26 14:47:48
 */
public interface ShoppingOrderFormService extends IService<ShoppingOrderForm> {

    /**
     * 根据条件来查询出订单列表信息
     * @param orderConditionDTO
     * @return
     */
    PageUtils queryOrderByCondition(OrderConditionDTO orderConditionDTO);

    /**
     * 查出所有物流公司
     * @return
     */
    List<LogisticsCompanyVO> queryLogisticsCompany();

    /**
     * 订单发货
     * @param orderShipmentDTO
     */
    void modifyOrderShipmentById(String id, String shipId, String shipCode, String cartId, String userId, String orderId);

    /**
     * 根据物流单号来查询物流记录
     * @param expressNo
     * @return
     * @throws Exception
     */
    LogisticsInformationVO getLogisticsInformationByExpressNo(String expressNo) throws Exception;

    /**
     * 根据id查出当前该商品的物流公司
     * @param id
     */
    ExpressCompanyVO getExpressNameById(Long id);

    /**
     * 修改物流
     * @param orderShipmentDTO
     */
    void modifyExpressNameOrShipCodeById(OrderShipmentDTO orderShipmentDTO);

    OrderDetailsVO getOrderByIds(String id);

    /**
     * 商城订单详情
     * @param orderId
     * @return
     */
    OrderDetailsVO getOrderById(String orderId);

    /**
     * 导出商城订单
     * @param response
     * @param request
     * @throws NormalException
     */
    void orderExcel(HttpServletResponse response, HttpServletRequest request) throws NormalException;

    /**
     * 子订单发货
     * @param orderShipmentDTO
     */
    String modifyOrderShipmentByCardId(OrderShipmentDTO orderShipmentDTO);

    /**
     * 修改子订单物流信息
     * @param orderShipmentDTO
     */
    void modifyExpressNameOrDeliveryNoById(OrderShipmentDTO orderShipmentDTO);

    /**
     * 子订单物流公司
     * @param id
     * @return
     */
    ExpressCompanyVO getExpressNameByCartId(Long id);

    /**
     * 发货时查出没有售后的订单信息
     * @param id
     * @return
     */
    List<SubOrderListVO> notIssuedGoods(Long id);

    /**
     * 候鸟订单信息发货状态
     */
    void selectHNOrder();

    /**
     * 通知供应商发货
     * @param id
     */
    void notifySupplier(String id);
}

